package com.uduew.sjd.ui.mine

import android.os.Bundle
import android.view.View
import com.uduew.sjd.BR
import com.uduew.sjd.R
import com.uduew.sjd.ui.base.BaseFragment
import com.uduew.sjd.ui.base.StateHolder
import com.hjq.bar.OnTitleBarListener
import com.hjq.bar.TitleBar
import com.kunminx.architecture.ui.page.DataBindingConfig
import com.kunminx.architecture.ui.state.State

class AboutUsFragment : BaseFragment() {

    lateinit var mState: SettingStates

    override fun initViewModel() {
        mState = getFragmentScopeViewModel(SettingStates::class.java)
    }


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
    }

    override fun getDataBindingConfig(): DataBindingConfig {

        return DataBindingConfig(R.layout.fragment_about_us, BR.vm, mState)
            .addBindingParam(BR.click, ClickProxy())
            .addBindingParam(BR.titleBarListener, TitleBarListener())
    }

    class SettingStates : StateHolder() {
        val text: State<String> = State("set")
    }

    inner class TitleBarListener : OnTitleBarListener {
        override fun onLeftClick(titleBar: TitleBar?) {
            super.onLeftClick(titleBar)
            nav().popBackStack()
        }

        override fun onRightClick(titleBar: TitleBar?) {
            super.onRightClick(titleBar)
        }
    }

    open inner class ClickProxy {

    }

}